class Solution(object):
    def productExceptSelf(self, nums):
        """
        :type nums: List[int]
        :rtype: List[int]
        """
        result = [1 for _ in range(len(nums))]
        acc = 1
        for i in range(len(nums)-1):
            acc *= nums[i]
            result[i+1] *= acc
        acc = 1
        for i in range(len(nums)-1, 0, -1):
            acc *= nums[i]
            result[i-1] *= acc
        return result

print(Solution().productExceptSelf([0,1,2,3,4,5]))
            
